home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9009 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  5.9 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: About time this stupid "knocks the crap" subject was dropped!
  5. Date: 7 Mar 1996 09:36:32 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4hn6r0INN71t@keats.ugrad.cs.ubc.ca>
  8. References: <00001a73+00002504@msn.com> <DnuGrG.JrE@news.thomson-lcr.fr> <4hl082INNc7d@keats.ugrad.cs.ubc.ca> <4hmmhi$52m@tomquartz.niestu.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4hmmhi$52m@tomquartz.niestu.com>,
  12. Chip Richards <chipr@niestu.com> wrote:
  13.  >In article <4hl082INNc7d@keats.ugrad.cs.ubc.ca>, Kazimir Kylheku wrote:
  14.  >
  15.  >   Computing g(x) when f(x) is intended falls under my definition of
  16.  >   crap. It's a programming error that can have all kinds of consequences to
  17.  >   the rest of the program whose detection is beyond the semantic analysis of
  18.  >   any compiler.
  19.  >
  20.  >You've been milking this one bug for almost two weeks now.  Get over it, man!
  21.  >Do you really do so little programming that one bug has occupied your
  22.  >attention for this long?  Haven't you found any others yet?  Wow, get busy!
  23.  
  24. It is not one bug, it is one important _kind_ of bug. I have another example:
  25. and this was probably the longest I have spent chasing a _single_ bug (though
  26. in the chase, I uncovered others, no doubt). This was in a completely unrelated
  27. project of a personal nature. I anticipate that Mr. Dewar (insert appropriate
  28. title in place of Mr.) might immediately point a finger and utter ``Academic
  29. fooling around! Not real work!''. 
  30.  
  31. Last January I developed a MC68010 emulator for testing portions of a little
  32. embedded OS before placing it on the ``iron''. To do the dipatching of
  33. emulation routines from machine-language opcodes, I used a large look-up table.
  34. Not wanting to moronically punch this table in by hand, I wrote a utility which
  35. would take a special description file and generate the table for me. The
  36. description file consisted of symbolic names paired with regular expressions
  37. for typographically matching bit patterns. E.g. the bit pattern ^0110...1  will
  38. match an opcode with an 0110 in the highest nibble, followed by three arbitrary
  39. bits, followed by 1. Normal UNIX-style regex syntax.
  40.  
  41. Now, I eventually got the thing close to done in about two or three weeks, and
  42. was testing it on tougher and tougher problems. I started running C programs
  43. doing floating point calculations (implemented with GNU assembly floating
  44. routines). I discovered that division was not working correctly.
  45.  
  46. I spent about three or four days (more like nights) chasing through the code,
  47. looking for the thing that was incorrect. Due to this intense search, I
  48. uncovered quite a few bugs, but not the one that I was looking for.
  49.  
  50. Eventually, when I had fixed every bug I could find by testing and code
  51. inspection, I turned to the regular expression file in frustration. I
  52. painstakingly verified the bit patterns against the Motorola specs, and bingo:
  53. There was the bug.
  54.  
  55. I fixed the bit pattern, regenerated the table, recompiled, ran the division,
  56. and there was the correct hex for the IEEE double-precision result.
  57.  
  58. No environment on God's green earth could have pointed the way to a faulty text
  59. file that has nothing to do with the language I'm working in. Yet it's the kind
  60. of obnoxious bug that can really waste my time. Now, that _could_ have
  61. something to do with the availability of debugging tools for dealing with those
  62. _other_ kinds of bugs... many of which are standard with Ada. (See, I'm not too
  63. thick to see that!)
  64.  
  65.  >(Kazimir, in all seriousness, I bear you no ill will.  You are clearly bright,
  66.  >fairly well informed, and are doubtless an asset to the programming community
  67.   ^^^^^^^^^^^^^^^^^^^^
  68.  
  69. Though not well informed enough about Ada. I have clearly been playing the role
  70. of a skeptic. I have a hard time accepting some off-the-wall claims. What good
  71. are they to _anyone_?
  72.  
  73.  >at large, and will become moreso in the future.  But as you are finding out,
  74.  >you can't cling so firmly to your opinions without attracting the attention of
  75.  >people who want to loosen your hold on them just a bit! <grin>  An open mind
  76.  >is your best defense.
  77.  
  78. I have an open mind: I'm very enthusiastic about Ada, and of course I believe
  79. that it has all kinds of advantages to make it easier to write reliable
  80. programs. Duh, you would have to be a blockead to not see it. But let's not be
  81. overzealous with this language advocacy thing. I get e-mail from people that
  82. for some reason thing that I'm slamming Ada because in reading a Usenet
  83. posting, they see what they want to see (and I'm not sure whether I'm
  84. altogether free of guilt in this regard, myself.) It's clear that Ada is a
  85. great achievement, and apparently it is even something that inspires religious
  86. devotion in programmers. That can only be an indicator of something good, IMHO.
  87.  
  88.  >I look forward to hearing about your upcoming experience with Ada--I hope it
  89.  >proves a positive and enlightening one.  Also, I sure hope it's Ada95.
  90.  >
  91.  >And I'd take *ten* Kazimir Kylheku rants in place of *one* post from CJ3!)
  92.  
  93. Is that so? ;) 
  94.  
  95. Don't encourage me. I really don't want to rant anymore in this thread; it's
  96. much more interesting reading and responding to posts in comp.lang.c. Since I
  97. joined, I have seriously upgraded my knowledge of C. I was surprised at how
  98. much I _didn't_ know, despite using it for years. Yet, with access to the right
  99. documents and motivation (brought about by being roasted regularly), I quickly
  100. brought myself up to par. The neat thing is that it radically changed the way I
  101. approach coding.
  102.  
  103. I hope I can lay my hands on the Ada ISO documents. Getting a hold of a library
  104. copy of the 83 will probably be easier; ISO documents are expensive and hence
  105. libraries are accordintly somewhat selective in their purchase orders. It's not
  106. likely that I can easily find the 1995 standard.
  107.  
  108. Are there cheaper, more secular ;), publications which carry much of the body
  109. of the Ada standards?
  110. -- 
  111.  
  112.